Skip to content

Instantly share code, notes, and snippets.

@tomturton
tomturton / 01-prototype-pattern.js
Last active May 10, 2024 01:02
Comparison of JavasScript object 'instantiation' methods
/*
'Prototype' pattern
-------------------
Traditional pattern to emulate classical inheritance in JavaScript
Pros:
- already used by majority of OO JS developers
- performs well
@daviCalavera
daviCalavera / objectUtils.js
Last active May 10, 2024 01:02
Useful functions with objects
/**
*
*/
export const deepFreeze = (obj) => {
// Retrieve the property names defined on obj
const propNames = Object.getOwnPropertyNames(obj);
// Freeze properties before freezing self
propNames.forEach((name) => {
let prop = obj[name];
@xenova
xenova / tiktoken-to-hf.ipynb
Last active May 10, 2024 00:59
Convert tiktoken tokenizers to the Hugging Face tokenizers format
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@genadyp
genadyp / productivity.md
Created February 18, 2021 11:49
productivity
@fnky
fnky / ANSI.md
Last active May 10, 2024 00:58
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
{
"currencies": [
{
"code": "EUR",
"description": "Euro",
"symbol": "",
"alignment": "L",
"groupingSeparator": ",",
"decimalSeparator": ".",
"decimals": 2,

An guide how to activate Windows 11 Pro for free

Why?

Because you will get some more features like an Bitlocker and host your device as an External Desktop which can be accessed through the internet

Am i also able to switch from any other edition to Pro?

The answer is yes! You can switch from almost any edition to Pro completely for free!

Note for users with unactivated Pro edition

People which already have Pro, but not activated, can skip to this step.

Getting started

What you first need to do is open CMD (Command Prompt) as Administrator using this keyboard key:

#include <stdio.h>
#include <SDL2/SDL.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
const int WINDOW_WIDTH = 640;
const int WINDOW_HEIGHT = 480;
const int GRID_WIDTH = 640;
const int GRID_HEIGHT = 480;
@samber
samber / README.md
Last active May 10, 2024 00:46
Password leak check (data source: 4iQ - Dec 2017 - 1.4 billion creds)
#
# This script builds a database containing credentials, in order to check if email+password have leak.
# For a few searchs, the grep command is perfect. No need of an aircraft carrier for fishing in a lake. ;)
# Data source contains 1.4 billon (yes, billon!) passwords from 4iQ (41GB large)
#
# PS: Use. Don't abuse !
#

mkdir 1.4B-password-dump/
@lyonzy
lyonzy / tuya_mcu_alt.h
Last active May 10, 2024 00:42
ESPHome custom Climate for "alternate" Tuya MCUs
/*
ESPHome custom component for Arlec Grid Connect Smart Panel Heater.
This heater contains an MCU that's not the standard "tuya" integration in ESPHome.
Probably works for similar panel heaters e.g. Devola, Kogan.
Not implemented:
- the Wifi icon on the panel (but this would be a simple improvement given the info in the sources below)
- the timer, for the same reasoning as Neon Ninja (Home Assistant is more powerful anyway)
Doesn't seem to have any issues being booted from the USB-Serial adapter (outside the heater) as mentioned on the Tasmota page, but YMMV.